package cn.springmvc.dao.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import cn.springmvc.dao.BaseDAO;
import cn.springmvc.model.entity.PhotoBean;

@Repository
public class PhotoDAOImpl implements BaseDAO<PhotoBean> {
	@Autowired(required=true)
	private SqlSession sqlSession;
	
	public boolean insert(PhotoBean t) {
		return sqlSession.insert("insertPhoto", t) > 0;
	}

	public List<PhotoBean> select(PhotoBean t) {
		return sqlSession.selectList("selectPhoto",t);
	}

	public boolean delete(PhotoBean t) {
		return sqlSession.delete("deletePhoto", t) > 0;
	}

	public boolean update(PhotoBean t) {
		return sqlSession.update("updatePhoto", t) > 0;
	}

	public PhotoBean selectOne(PhotoBean t) {
		return sqlSession.selectOne("selectOnePhoto", t);
	}

}
